//
//  AccountHeaderView.m
//  EasyToTesco2.0
//
//  Created by 袖手旁觀 on 16/6/16.
//  Copyright © 2016年 EasyToTesco. All rights reserved.
//

#import "AccountHeaderView.h"

@interface AccountHeaderView ()

@property (nonatomic,strong)UIImageView *headerImg;



@end

@implementation AccountHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self == [super initWithFrame:frame]) {
        [self loadHeaderView];
    }
    return self;
}

- (void)loadHeaderView {
    UIImageView *headImg = [[UIImageView alloc] init];
    headImg.layer.cornerRadius = self.Height/5;
    headImg.layer.masksToBounds = YES;
    headImg.image = [UIImage imageNamed:@"headgao.jpg"];
    [self addSubview:headImg];
    
    UILabel *textLabel = [[UILabel alloc] init];
    textLabel.font = [UIFont systemFontOfSize:16];
    textLabel.textAlignment = NSTextAlignmentCenter;
    self.textLabel = textLabel;
    [self addSubview:textLabel];
    
    [headImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.top.equalTo(self.mas_top).with.offset(self.Height/8);
        make.height.mas_equalTo(self.Height/2.5);
        make.width.mas_equalTo(self.Height/2.5);
        
    }];
    
    [textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.mas_centerX);
        make.top.equalTo(headImg.mas_bottom).with.offset(self.Height/10);
        make.width.mas_equalTo(self.width/6);
    }];
}

@end
